﻿<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xanx="http://schemas.microsoft.com/developer/xanx/2005"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><META NAME="save" CONTENT="history">
<title>Spacewar Starter Kit</title>
<!-- v1.4 -->

<style><!--
/***********************************************************
 *             SCRIPT-SUPPORTING STYLES
 ***********************************************************/

/* Defines the userData cache persistence mechanism. */
.userDataStyle
{
	behavior: url(#default#userData);
}

/* Used to save the scroll bar position when navigating away from a page. */
div.saveHistory
{
	behavior: url(#default#saveHistory);
}

/* Formats the expand/collapse images for all collapsible regions. */
img.toggle
{
	border: 0;
	margin-right: 5;
}

/* Formats the Language filter drop-down image. */
img#languageFilterImage
{
	border: 0;
	margin-left: 0;
	vertical-align: middle;
}

/* Formats the Members Options filter drop-down image. */
img#membersOptionsFilterImage
{
	border: 0;
	margin-left: 0;
	vertical-align: middle;
}

/* Formats the Collapse All/Expand All images. */
img#toggleAllImage
{
	margin-left: 0;
	vertical-align: middle;
}

/* Supports XLinks */
MSHelp\:link
{
 	text-decoration: underline;
	color: #0000ff; 
	hoverColor: #3366ff;
	filterString: ;
}


body
	{
	background:	#FFFFFF;
	color: #000000;
	font-family:	Verdana;
	font-size: medium;
	font-style: normal;
	font-weight: normal;
	margin-top:	0;
	margin-bottom:	0;
	margin-left:	0;
	margin-right:	0;
	width:	100%;
	/*font-size: 110%;*/
	}

div.toggle_section
	{
	margin-left: 15px;
	}

div.h5
	{
	margin-left: 1.5em;
	}

/* Font for all headings */	
h1, h2, h3, h4, h5, h6
	{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	margin-top: 18;
	margin-bottom: 8; 
	font-weight: bold;
	}
h1
	{
	font-size: 130%;
	color: #003399;
	}
div#scrollyes h1 /* Changes font size for full-scrolling topic */
	{
	font-size: 150%;
	}
h2
	{
	font-size: 125%;
	}
h3
	{
	font-size: 115%;
	margin-top: 9;
	margin-bottom: 4; 
	}
h4
	{
	font-size: 100%;
	margin-top: 9;
	margin-bottom: 4; 
	}
	
h4.subheading3
	{
	font-size: 10px;
	margin-left: 0em;
	}

h5
	{
	font-size: 100%;
	margin-top: 9;
	margin-bottom: 4; 
	}

ul p, ol p, dl p
	{
	margin-left: 0em;
	}

p
	{
	margin-top: .6em;
	margin-bottom: .6em;
	}
	
td p
	{
	margin-top: 0.0em;
	margin-bottom: 0.6em;
	}

dd p
	{
	margin-top: 0.0em;
	margin-bottom: 0.6em;
	}

.image
	{
	text-align: center;
	}

dl
	{
	margin-top: 0em; 
	margin-bottom: 1.3em;
	}

dd
	{
	margin-bottom: 0em;
	margin-left: 0;
	}

dl.glossary dd 
{
	margin-bottom: 0em;  
	margin-left: 1.5em; 
}

dt
	{
	margin-top: .6em;
	margin-bottom: 1;
	}

ul, ol
	{
	margin-top: 0.6em;
	margin-bottom: 0.6em; 	
	}
	
ol
	{
	margin-left: 2.5em; 
	
	}	
	
ul
	{
	list-style-type: disc; 
	margin-left: 1.9em; 
	}

li
	{
	margin-bottom: 0.4em;
	}

ul ol, ol ol
	{
	list-style-type: lower-alpha;
	}

pre
	{
	margin-top: .6em;
	margin-bottom: .6em; 
	}

pre
	{
	font: 105% Lucida, mono; 
	color: #000066;
	}

code
{
	font-family: Monospace, Courier New, Courier;
	font-size: 105%;
	color:	#000066;
}

table.userdata td 
	{
	background: #ffffff;
	background-color: #F5F5F5;
	border-color: #ffffff;
	border: none;
	}	
table.clsWarning
	{
	background: #ffffff;
	padding: 0px;
	margin: 0px;
	border: none;
	}
table.clsWarning td
	{
	padding: 0px;
	margin: 0px;
	background: #ffffff;
	vertical-align: middle;
	font-size: 70%;
	}

div#mainSection table
	{
	width: 98%;
	background: #ffffff;
	margin-top: 5px;
	margin-bottom: 5px;
	}

div#mainSection table th
	{ 
	padding: 5px 6px;
	background: #EFEFF7;
	text-align: left;
	font-size: 70%;
	vertical-align: bottom;
	border-bottom: 1px solid #C8CDDE;
	}
div#mainSection table td
	{ 
	padding: 5px 5px;
	background: #F7F7FF;
	vertical-align: top;
	font-size: 70%;
	border-bottom: 1px solid #D5D5D3;
	}

div#mainSection table.syntax th
	{
	padding: 1px 6px;
	color: #000066;
	}

div#mainSection table.syntax td
	{
	padding: 1px 5px;
	}

/* Applies to the running header text in the first row of the upper table in the
   non-scrolling header region. */
span#runningHeaderText
{
	color: #003399;
	font-size: 90%;
	padding-left: 13;
}

/* Applies to the topic title in the second row of the upper table in the
   non-scrolling header region. */
span#nsrTitle
{
	color: #003399;
	font-size: 120%;
	font-weight: 600;
	padding-left: 13;
}

/* Applies to everything below the non-scrolling header region. */
div#mainSection
{
	font-size: 70%;
	width: 100%;
}

/* Applies to everything below the non-scrolling header region, minus the footer. */
div#mainBody
{
	font-size: 90%;
	margin-left: 15;
	margin-top: 10;
	padding-bottom: 20;
}

/* Adds right padding for all blocks in mainBody */
div#mainBody p, div#mainBody ol, div#mainBody ul, div#mainBody dl
{
	padding-right: 5;
}

div#mainBody div.alert, div#mainBody div.code, div#mainBody div.tableSection
{
	width:98.9%;
}

div.alert p, div.code p
{
	margin-top:5;
	margin-bottom:8;
}

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
div#mainSection div.alert table
{
	border: 0;
}

div#mainSection div.alert table th
{
	padding-top: 0;
	padding-bottom: 0;
	padding-left: 5;
	padding-right: 5;
}

div#mainSection div.alert table td
{
	padding-left: 5;
	padding-right: 5;
}

img.note
{
	border: 0;
	margin-left: 0;
	margin-right: 3;
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Non-scrolling Header Region Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* Applies to the entire non-scrolling header region. */
div#header
{
	background-color: #D4DFFF;
	padding-top:	0;
	padding-bottom:	0;
	padding-left:	0;
	padding-right:	0;
	width:	100%;
}

/* Applies to both tables in the non-scrolling header region. */
div#header table
{
	margin-top:	0;
	margin-bottom: 0;
	border-bottom-color: #C8CDDE;
	border-bottom-style: solid;
	border-bottom-width: 1;
	background: #D4DFFF;
	width:	100%;
}

/* Applies to cells in both tables in the non-scrolling header region. */
div#header table td
{
	color: #0000FF;
	font-size: 70%;
	padding-right: 20;
	padding-top: 1;
	padding-bottom: 1;
	border: none;
	background: #D4DFFF;
}

/* Applies to the last row in the upper table of the non-scrolling header region. Text 
   in this row includes See Also, Constructors, Methods, and Properties. */
div#header table tr#headerTableRow3 td
{
	padding-bottom: 2;
	padding-top: 5;
	padding-left: 15;
}

/* Applies to the lower table in the non-scrolling header region. Text in this table
   includes Collapse All/Expand All, Language Filter, and Members Options. */
div#header table#bottomTable
{
	border-top-color: #FFFFFF;
	border-top-style: solid;
	border-top-width: 1;
	text-align: left;
	padding-left: 15;
}


blockquote
	{
	margin-left: 3.8em;
	margin-right: 3.8em;
	margin-top: .6em;
	margin-bottom: .6em;
	}

sup
	{
	text-decoration: none;
	font-size: smaller; 
	}

a:link
	{
	color: #0000FF;
/*    font-weight: bold */
	}
	
a:visited
	{
	color: #0000AA;
/*    font-weight: bold	*/
	}
	
a:hover
	{
	color: #3366FF;
/*    font-weight: bold */
	}
	
.label
	{
	font-weight: bold; 
	margin-top: 1em;
	margin-left: -26px;
	}
	
.tl
	{
	margin-bottom: .75em; 
	}
	
.atl
	{
	padding-left: 1.5em;
	padding-bottom: .75em; 
	}
	
.cfe
	{
	font-weight: bold; 
	}
	
.mini
	{
	font-size: smaller;
	}
	
.dt
	{
	margin-bottom: -.6em; 
	}
	
.indent
	{
	margin-left: 1.9em; 
	margin-right: 1.9em;
	}

.product
	{
	text-align: right;
	color: #333333;
	font-size: smaller;
	font-style: italic;
	}

.buttonbarshade
	{
	position: relative;
	margin: 0;
	left: 0px;
	top: 2;
	width: 50%;
	height: 40px;
	}

.buttonbartable
	{
	position: absolute;
	margin: 0;
	padding:0;
	border:0;
	left:0px;
	top: 2;
	width: 100%;
	height: 40px;
	}

/* background color, font for header */ 
table.buttonbartable td, table.buttonbarshade td
	{
	background: #ffffff; /*#5177B8; #80C615;*/
	border-left: 0px solid #80C615;
	margin: 0;
	padding: 0px 0px 0px 0px;
	font-family: Impact, sans-serif;
	font-size: 14pt;
	}

table.buttonbartable td.button1
	{
	background: #5177B8; /*#80C615;*/;
	padding: 0;
	font-weight: bold;
	text-align: center;
	cursor: hand;
	}

table.buttonbartable td.button2
	{
	background: #5177B8; /*#80C615;*/;
	font-weight: bold;
	text-align: center;
	}

table.buttonbartable td.button3
	{
	background: #5177B8; /*#80C615;*/;
	font-weight: bold;
	text-align: center;
	}

table.buttonbartable td.runninghead
	{
	padding-left: 0px;
	font-style: italic;
	text-align: left;
	}

.version
	{
	text-align: left;
	color: #000000;
	margin-top: 3em;
	margin-left: -26px;
	font-size: smaller;
	font-style: italic;
	}

.lang, .ilang
	{
	color: #0000ff;
	font: normal 7pt Arial, Helvetica, sans-serif;
	}

div.langMenu
	{
	position: absolute;
	z-index: 1;
	width: 96pt;
	padding: 8pt;
	visibility: hidden;
	border: 1px solid #000000;
	background: #ffffd0;
	}

div.langMenu ul
	{
	padding-left: 2em;
	margin-left: 0;
	}

div.filtered
	{
	margin: 4pt 0 8pt -26px;
	padding: 4px 4px 8px 26px;
	width: 100%;
	border: 2px solid #aaaacc;
	background: #ffffff;
	}

div.filtered2
	{
	margin: 4pt 0 8pt -26px;
	padding: 4px 4px 8px 26px;
	width: 100%;
	border: none;
	background: #ffffff;
	}

div.filtered h1, div.filtered h2, div.filtered h3, div.filtered h4
	{
	margin-left: -22px;
	}

div.filtered span.lang
	{
	position: relative;
	left: -22px;
	}

div.reftip
	{
	position: absolute;
	z-index: 1;
	padding: 8pt;
	visibility: hidden;
	border: 1px solid #000000;
	background: #ffffd0;
	}

pre.syntax
	{
	background: #dddddd;
	color: #000000;
	padding: 2pt,4pt;
	margin-top:1.0em;
	cursor: text;
	}

pre.syntax_nojs
	{
	background: #dddddd;
	color: #000000;
	padding: 2pt,4pt;
	cursor: text;
	}

a.synParam
	{
	color: #0000FF;
	/*color: #3F7800;*/ 	
	/*color: #8DC54F;*/
	text-decoration: none;
    font-weight: normal;
	}

a.synParam:hover
	{
	text-decoration: underline;
    font-weight: normal;
	}

div.sapop
	{
	position: absolute;
	z-index: 1;
	left: 26px;
	width: 100%;
	padding: 10px 10px 10px 36px;
	visibility: hidden;
	border: 1px solid #000000;
	background: #ffffd0;
	}

div.footer
	{
	width: 100%;
	border: none;
	background: #ffffff;
	margin-top: 18pt;
	padding-bottom: 12pt;
	color: #0000FF;
	/*color: #228B22; */
	text-align: center;
	font-size: 76%;
	}

div.preliminary
	{
	margin-top: 8pt;
	padding-bottom: 12pt;
	color: #A0A0A0;
	}

/* A procedure section. eg. 'To create a file', 'To add a value' */
div.proc
    {
	margin-left: 0.5em; 
    }
     
/* The title of a 'procedure' section. */
div.proch
    {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 115%;
	margin-top: 1em;
	margin-bottom: 0.4em;
	margin-left: -0.5em; 
	color: #003399;
    }

div.proc ul
    {
    margin-left: 1.5em;
    }

div.proc ol
    {
    margin-left: 2.0em;
    }
      
.note
	{
	margin-left: 14pt;
	margin-right: 12pt;
	}

.indent1
	{
	margin-left: 12pt;
	}

.indent2
	{
	margin-left: 24pt;
	}

.indent3
	{
	margin-left: 36pt;
	}

p.proch
	{
	padding-left: 16px;
	}

p.proch img
	{
	position: relative; 
	vertical-align: top;
	left: -18px; 
	margin-right: -14px; 
	margin-bottom: -18px;
	}
	
div.clsPlatSpec
{
	background-color:#FFF8DC;
	border-style:solid;
	border-width:1pt 0pt 0pt 1pt;
	border-color:#ffE4C4;
	margin-top:0.6em;
	width:100%;
}


/* Applies to the language labels in the Language Filter drop-down list. */
.languageFilter
{
	color:	#0000FF;
	cursor:hand;
	text-decoration:underline;
	padding-bottom:4;
}

/* Dropdown areas */

#languageSpan {
	position: absolute;
	visibility: hidden;
	border-style: solid;
	border-width: 1px;
	border-color: #C8CDDE;
	background: #d4dfff;
	padding: 4px;
	font-size: 70%;
}

#membersOptionsSpan {
	position: absolute;
	visibility: hidden;
	border-style: solid;
	border-width: 1px;
	border-color: #C8CDDE;
	background: #d4dfff;
	padding: 4px;
	font-size: 70%;
}
--></style>
</head><body><div id="mainSection"><div id="mainBody">
  <h1>Spacewar Starter Kit</h1>
  

  <p>This topic contains the following sections.</p>
  <ul><li><a href="#ID0EP">Introduction</a></li><li><a href="#ID0ELB">Goals</a></li><li><a href="#ID0EAC">Getting Started</a></li><li><a href="#extending">Extending Spacewar</a></li></ul>

  <h1><a name="ID0EP"></a>Introduction</h1><div id="ID0EP" class="h1">
    

    <p>This Microsoft XNA™ Game Studio Express Starter Kit is a complete starship combat game. The project comes ready to compile and run, and is easy to customize with only a little extra C# programming. The <a href="#extending">Extending Spacewar</a> section contains a list of some customizations you might make. You are also free to use the source code as the basis for your own XNA Game Studio Express game projects, and to share your work with others.</p>

    <p>Spacewar is provided in XNA Game Studio Express for your enjoyment and modification. The game comes in two versions: Retro and Evolved. The Retro version is inspired by the first implementation of Spacewar, developed by Stephen Russell, Peter Samson, and Dan Edwards in 1962 for the DEC PDP-1; the Evolved version features similar gameplay, but with 3D models and effects.</p>

    <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>This documentation assumes that you have a basic knowledge of programming concepts and the Visual C# environment. You can learn more about these topics in the product documentation by clicking one of the <b>Help</b> menu items, or by positioning the mouse cursor on language keywords or user interface elements such as windows or dialog boxes, and then pressing <b>F1</b>.</td></tr></table></div>

  </div>

  <h1><a name="ID0ELB"></a>Goals</h1><div id="ID0ELB" class="h1">
    
    <p>This starter kit provides a complete XNA Game Studio Express game, including source code and game content such as 3D models, textures, and sounds.  This starter kit documentation describes the Spacewar game, and then suggests interesting customizations you can make.  The Spacewar starter kit demonstrates:</p>
    <ul>
      <li>XNA Framework, including the Application Model and Content Pipeline</li>
      <li>Game graphics, audio, and input</li>
      <li>Game concepts such as collision detection and the game loop</li>
      <li>C# Language</li>
    </ul>
  </div>


  <h1><a name="ID0EAC"></a>Getting Started</h1><div id="ID0EAC" class="h1">
    

    <h2><a name="ID0EEC"></a>Creating, Building, and Running a Spacewar Project</h2><div id="ID0EEC" class="h2">
      
      <p>You can create multiple Spacewar projects.  Each is a complete, stand-alone game that you can build, run, and modify as desired.</p>
      <div class="proc">
        <div class="proch">To create a new Spacewar project</div>
        <ol>
          <li>
            <p>
              On the Visual C# Express <b>File</b> menu, click <b>New Project</b>.
            </p>
            <p>
              The <b>New Project</b> dialog box appears, displaying the project types you can create. Among these are the XNA Game Studio Express project types, such as <b>Xbox 360 Game</b> and <b>Spacewar Windows Starter Kit</b>.
            </p>
          </li>
          <li>
            <p>
              Choose <b>Spacewar Windows Starter Kit</b>, and then click <b>OK</b>.
            </p>
          </li>
        </ol>
        <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>The starter kit may take a minute or two to load.</td></tr></table></div>
      </div>

      <div class="proc">
        <div class="proch">To build and run the Spacewar project</div>
        <ol>
          <li>
            press <b>F5</b>, or, on the <b>Debug</b> menu, click <b>Start Debugging</b>.
          </li>
          <p>The project will build and then run within the debugger.</p>
        </ol>
        <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>
          The project may take several minutes to build before it can be launched.  To see build progress during the build, display the output window (from the <b>View</b> menu, click <b>Output</b>) before starting the build.
        </td></tr></table></div>
      </div>

      <div class="proc">
        <div class="proch">To build the project without running it</div>
        <ol>
          <li>
            press <b>F6</b>, or, on the <b>Build</b> menu, click <b>Build Solution</b>.
          </li>
          <p>The project will build without running.</p>
        </ol>
      </div>

      <p>
        When Spacewar starts it displays the main screen where you can choose to play the <b>Retro</b> or <b>Evolved</b> versions of the game, or see controller <b>Info</b>.
      </p>
    </div>

    <h2><a name="ID0EKF"></a>Playing Spacewar</h2><div id="ID0EKF" class="h2">
      
      <p>Spacewar can be played by one or two players. Players first choose a ship type and color; then, the battle begins. The goal in Spacewar is to use your ship's weapon to destroy your opponent's ship, but beware! Your opponent's weapon is not the only threat: You must also avoid the gravitational pull of the sun or be destroyed!</p>

      <p>You score points by destroying your opponent. After each round of play, the cash you earned from annihilating your enemy can be used to buy new weapons for the next round.</p>

      <h3><a name="ID0ESF"></a>Spacewar Controls</h3><div id="ID0ESF" class="h3">
        
        <p>You can use a keyboard or Xbox 360 controller to play Spacewar.  The controls are mapped as follows:</p>
        <table>
          <tr>
            <th>Action</th>
            <th>Controller</th>
            <th>Keyboard P1</th>
            <th>Keyboard P2</th>
          </tr>
          <tr>
            <td>Select ship type, color, and weapon</td>
            <td>D-pad</td>
            <td>A, D, W, S</td>
            <td>arrow keys or keypad arrows</td>
          </tr>
          <tr>
            <td>Fire weapon</td>
            <td>Right trigger or <b>A</b></td>
            <td>V</td>
            <td>keypad 7, keypad <b>.</b>, <b>Home</b>, or <b>Delete</b></td>
          </tr>
          <tr>
            <td>Rotate ship, forward and reverse thrust</td>
            <td>Left thumbstick</td>
            <td>A, D, W, S</td>
            <td>arrow keys or keypad arrows</td>
          </tr>
          <tr>
            <td>Hyperspace warp</td>
            <td>Left trigger or <b>B</b></td>
            <td>G</td>
            <td>keypad 1, keypad 0, <b>End</b>, or <b>Insert</b></td>
          </tr>
          <tr>
            <td>Pause</td>
            <td>Back</td>
            <td>Left <b>SHIFT</b></td>
            <td>Right <b>SHIFT</b></td>
          </tr>
		</table>
		<br />
		<table>
            <th>Button</th>
            <th>Keyboard P1</th>
            <th>Keyboard P2</th>
		  <tr>
			<td><b>A</b></td>
			<td>V</td>
			<td><b>Home</b> or keypad 7</td>
		  </tr>
		  <tr>
			<td><b>B</b></td>
			<td>G</td>
			<td><b>End</b> or keypad 1</td>
		  </tr>
		  <tr>
			<td><b>X</b></td>
			<td>F</td>
			<td><b>Page Up</b> or keypad 9</td>
		  </tr>
		  <tr>
			<td><b>Y</b></td>
			<td>T</td>
			<td><b>Page Down</b> or keypad 3</td>
		  </tr>
        </table>
      </div>
    </div>

  </div>

  <h1><a name="extending"></a>Extending Spacewar</h1><div id="extending" class="h1">
    
    <p>The Spacewar starter kit contains many models, textures, and sounds that you can experiment with to make changes to the graphics and audio in the game.  From making a few small changes in Spacewar, to significantly altering gameplay and graphics, to creating your own game using some of Spacewar's content, algorithms, or sample code, how you use this starter kit is entirely up to you.</p>

    <p>Here a just a few examples of the types of changes you can make to Spacewar.</p>

    <ul>
      <li>
        <p>Create or modify 3D models.</p>
        <p>You can add new 3D models that you create, modify, or download.  XNA Game Studio Express accepts geometry and model data in the DirectX X file format (.x) and Autodesk FBX format (.fbx).  Most 3D design tools will export to one of these two formats.</p>
        <p>For information about adding and using models, see the <b>Content Pipeline Overviews</b> and <b>3D Graphics</b> topics in the documentation.</p>
      </li>
      <li>
        <p>Create or modify textures.</p>
        <p>The textures associated with models can be changed. XNA Game Studio Express supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.</p>
        <p>For information about adding and using textures, see the <b>Content Pipeline Overviews</b> topic in the documentation.</p>
      </li>
      <li>
        <p>Create or modify shaders and effects.</p>
        <p>Spacewar comes with several effects, from the aptly named simple.fx to the more complex ship.fx.  Shaders and effects are powerful ways to control and enhance the lighting, materials, and textures of your models.  With a little bit of work and experimentation you can create truly amazing effects.</p>
        <p>For information about shaders and effects, see the <b>3D Graphics Overview</b> and <b>How to: Create and Apply Custom Effects</b> topics in the documentation.</p>
      </li>
      <li>Change ship performance: speed, rotation, and thrust.</li>
      <li>Change weapon characteristics: speed, damage, and reload time.</li>
      <li>Change game rules: earned money, turn length, and victory conditions.</li>
      <li>Without changing any code, you can modify the settings.xml file to change several game parameters including lighting, speed, gravity, thrust, as well as the keyboard mappings that the game uses.</li>
      <li>Make the Sun a 'third player'.  When the Sun destroys your ship, the points go to the Sun rather than your opponent.  Perhaps the Sun could win, or upgrade.</li>
      <li>Change the shaders used by the different models, for strange and unique effects.</li>
    </ul>

      
    <p>The <b>Getting Started with XNA Game Studio Express</b> section of the documentation contains some excellent walthroughs that show you how to use sprites, 3D graphics, models, textures, input, audio, and more.</p>

    <h2><a name="ID0E3CAC"></a>Example Change</h2><div id="ID0E3CAC" class="h2">
      
      <p>Here's an example modification that you can make to Spacewar.</p>
      
    <h3><a name="ID0ECDAC"></a>Rogue Asteroid!</h3><div id="ID0ECDAC" class="h3">
      
      <p>Make an asteroid available as one of the ship choices.</p>
      <ol>
        <li>
          <p>In the Evolved\EvolvedShape.cs file, change the p1_saucer ship mesh to the asteroid2 mesh:</p>
          <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>private static string[,] shipMesh = new string[,]
{
    {
        @"models\p1_pencil",
        @"models\asteroid2",  // @"models\p1_saucer",
        @"models\p1_wedge",
    },</pre></td></tr></table></span></div>
        </li>
        <li>
          <p>In the same file, change the texture used by that ship mesh (or you can keep the original ship texture for a truly evolved asteroid):</p>
          <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>private static string[,] shipDiffuse = new string[,] 
{
    {
        @"textures\pencil_p1_diff_v{0}",
        @"textures\asteroid2", // @"textures\saucer_p1_diff_v{0}",
        @"textures\wedge_p1_diff_v{0}",
    },</pre></td></tr></table></span></div>
        </li>
      </ol>
      <p>That's all there is to it.  Player one's second ship choice (the saucer) is now rendered as an asteroid.  These ship models and textures are loaded in EvolvedShape.Render using the <b>ContentManager.Load</b> method:</p>
      <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>model = SpacewarGame.ContentManager.Load&lt;Model&gt;(SpacewarGame.Settings.MediaPath + shipMesh[(int)player, shapeNumber]);
texture = SpacewarGame.ContentManager.Load&lt;Texture2D&gt;(SpacewarGame.Settings.MediaPath + String.Format(shipDiffuse[(int)player, shapeNumber], (skinNumber + 1)));</pre></td></tr></table></span></div>
      <p>Some possible further Rogue Asteroid modifications:</p>
      <ul>
        <li>Change the 2D ship shown on the ship selector screen to match the asteroid (you'll need to edit the textures\ship_select_FINAL.tga texture).</li>
        <li>Change the rotation axis of the asteroid so that it rotates about its short axis instead of its long axis.</li>
        <li>Change the engine thrust offset, characteristics, or color.  The Ship.cs file performs the engine thrust calculations and rendering (look at the Update and Render methods).</li>
        <li>Change the materials or effect used by the rogue asteroid.</li>
        <li>Change the weapon power and speed of the asteroid.</li>
      </ul>
    </div>

      <h3><a name="ID0E4EAC"></a></h3><div id="ID0E4EAC" class="h3">
        
      </div>
    </div>
  </div>
</div></div></body></html>